package com.veryGood.service.Impl;

import com.veryGood.common.result.R;
import com.veryGood.domain.dto.LoginDto;
import com.veryGood.mapper.LoginMapper;
import com.veryGood.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {

    @Autowired
    private LoginMapper loginMapper;


    public R login(LoginDto loginDto) {
        LoginDto ll = loginMapper.findAdminByAccount(loginDto.getUserName());

        if (ll !=null && ll.getUserPwd().equals(loginDto.getUserPwd())) {
            return R.success("hi");
        }
        return R.error("SORRY");
    }
}